<%@page import="java.util.UUID"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/pages/common/taglib.jsp"%>
<%
	String uuid = UUID.randomUUID().toString();
	request.setAttribute("uuid", uuid);
%>
<div class="row">
	<div class="col-md-12">
		<div class="box box-primary">
			<div class="box-body">
				<table id="funcPointForMenuGrid_${uuid}">

				</table>
			</div>
			<div class="box-footer clearfix no-border" id="funcPointForMenuGridTb_${uuid}">
				<button class="btn btn-primary pull-right btn-sm addBtn">
					<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
					选择
				</button>
			</div>
		</div>
	</div>
</div>

<script type="text/javascript">
	$(function() {
		var uuid = '${uuid}';
		var funcPointForMenuGrid = $("#funcPointForMenuGrid_" + uuid);
		var funcPointForMenuGridTb = $("#funcPointForMenuGridTb_" + uuid);
		//功能点定义部分
		funcPointForMenuGrid = funcPointForMenuGrid.bootstrapTable({
			url : ctx + "/funcPointAction/queryFuncPoints.do",
			columns : [ {
				field : '_id',
				checkbox : true
			},{
				title : '功能点名称',
				field : 'name',
				width : 200,
				filterControl : "input"
			}, {
				title : 'URL地址',
				field : 'url',
				width : 300,
				filterControl : "input"
			} ],
			filterControl : true,
			height : $(window).height() * 0.7
		});

		funcPointForMenuGridTb.find(".addBtn").click(
				function() {
					var rows = funcPointForMenuGrid.bootstrapTable("getSelections");
					if (!rows || rows.length <= 0) {
						webUtils.alert("请选择数据");
					} else {
						top.webUtils.topicPublish("funcPointForMenu.selected",
								rows[0]);
					}
				});

	});
</script>